#ifndef NPC_H
#define NPC_H

#include <vector>
#include <map>
#include <string>
#include "types.h"
#include "RakPeerInterface.h"
#include "player.h"

class Player;

class Npc
{
    private:
        static std::map<int, Npc*> Npcs;
        int id;
        std::string name;

        position pos;
        float velX, velY;
        int movementSpeed;

        Player* combatPlayer;
        std::vector<position> path;

        void calculate_vel();
        void stop();
        position attack_pos(Player* player);

    public:
        Npc(int id, std::string name, int x, int y);
        ~Npc();

        static Npc* GetNpcFromID(int id);
        static std::map<int, Npc*> GetNpcList();

        void work(unsigned long deltaTicks);
        void move(unsigned long deltaTicks);
        //void create_flag(int x, int y);
        void walk_to(int x, int y);
        void attack(Player* player);

        void send_flag(int x, int y);
        void send_attack();

        std::string get_name();
        int get_id();
        bool moving();

        int x();
        int y();
        int flag_x();
        int flag_y();

        void set_x(int x);
        void set_y(int y);
};

#endif // NPC_H
